import config from '@/config';
import http from '@/utils/request';

export default {
	page: {
		url: `${config.API_URL}/procprocess/pages`,
		name: '分页',
		get: async function (params) {
			return await http.get(this.url, params);
		},
	},
	pagesbylineid: {
		url: `${config.API_URL}/procprocess/pagesbylineid`,
		name: '按产线Id查询所有分页',
		get: async function (params) {
			return await http.get(this.url, params);
		},
	},
	listbylineid: {
		url: `${config.API_URL}/procprocess/listbylineid`,
		name: '列表',
		get: async function (params) {
			return await http.get(this.url, params);
		},
	},
	tree: {
		url: `${config.API_URL}/procprocess/tree/`,
		name: '树节点展示',
		get: async function () {
			return await http.get(this.url);
		},
	},
	model: {
		url: `${config.API_URL}/procprocess/`,
		name: '查询一条',
		get: async function (params) {
			return await http.get(this.url + params);
		},
	},
	add: {
		url: `${config.API_URL}/procprocess`,
		name: '添加',
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	update: {
		url: `${config.API_URL}/procprocess`,
		name: '修改',
		put: async function (data) {
			return await http.put(this.url, data);
		},
	},
	delete: {
		url: `${config.API_URL}/procprocess`,
		name: '删除',
		delete: async function (data) {
			return await http.delete(this.url, data);
		},
	},
};
